package controller.SaleTable;

import entity.MsgResult;
import entity.goods2;
import entity.sale2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import service.SelectSaleBySelectiveService;

import java.util.HashMap;
import java.util.List;

@Controller
public class SelectSaleBySelectiveController {

    @Autowired
    private SelectSaleBySelectiveService selectSaleBySelectiveService;

    @RequestMapping("/selectSaleBySelective")
    @ResponseBody
    public MsgResult selectSaleBySelective(sale2 sale2){
        MsgResult msgResult = new MsgResult();
        HashMap<String, Object> map = new HashMap<>();
        List<entity.sale2> sales = selectSaleBySelectiveService.selectSaleBySelective(sale2);
        map.put("sales",sales);
        msgResult.setFlag(1);
        msgResult.setData(map);
        return msgResult;
    }
}
